package com.bosssoft.springcloud.service.impl;

import com.bosssoft.springcloud.dao.UserDao;
import com.bosssoft.springcloud.entity.dto.UserDTO;
import com.bosssoft.springcloud.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Resource
    private UserDao userDao;

    /***
     * 查询所有用户信息
     * @return 用户信息列表
     */
    @Override
    public List<UserDTO> findAllUsers() {
        return userDao.findAllUsers();
    }

    /***
     * 根据用户名查询用户
     * @param username 用户名
     * @return 用户信息
     */
    @Override
    public UserDTO findUserByUsername(String username) {
        return userDao.findUserByUsername(username);
    }

    /***
     * 移除用户
     * @param id 用户id
     * @return
     */
    @Override
    public int removeUserById(int id) {
        return userDao.removeUserById(id);
    }

}
